//
// CSegRemanence.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CSegRemanence {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CSegRemanence(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CSegRemanence obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CSegRemanence(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public CSegRemanence() {
    this(nel3dJNI.new_CSegRemanence__SWIG_0(), true);
  }

  public CSegRemanence(CSegRemanence other) {
    this(nel3dJNI.new_CSegRemanence__SWIG_1(CSegRemanence.getCPtr(other), other), true);
  }

  public CSegRemanence assign(CSegRemanence other) {
    return new CSegRemanence(nel3dJNI.CSegRemanence_assign(swigCPtr, this, CSegRemanence.getCPtr(other), other), false);
  }

  public static void registerBasic() {
    nel3dJNI.CSegRemanence_registerBasic();
  }

  public static CTransform creator() {
    long cPtr = nel3dJNI.CSegRemanence_creator();
    return (cPtr == 0) ? null : new CTransform(cPtr, false);
  }

  public void render(IDriver drv, CMaterial mat) {
    nel3dJNI.CSegRemanence_render(swigCPtr, this, IDriver.getCPtr(drv), drv, CMaterial.getCPtr(mat), mat);
  }

  public void samplePos(double date) {
    nel3dJNI.CSegRemanence_samplePos(swigCPtr, this, date);
  }

  public void setupFromShape() {
    nel3dJNI.CSegRemanence_setupFromShape(swigCPtr, this);
  }

  public boolean canStartStop() {
    return nel3dJNI.CSegRemanence_canStartStop(swigCPtr, this);
  }

  public void start() {
    nel3dJNI.CSegRemanence_start(swigCPtr, this);
  }

  public void stop() {
    nel3dJNI.CSegRemanence_stop(swigCPtr, this);
  }

  public void stopNoUnroll() {
    nel3dJNI.CSegRemanence_stopNoUnroll(swigCPtr, this);
  }

  public boolean isStarted() {
    return nel3dJNI.CSegRemanence_isStarted(swigCPtr, this);
  }

  public boolean isStopping() {
    return nel3dJNI.CSegRemanence_isStopping(swigCPtr, this);
  }

  public void restart() {
    nel3dJNI.CSegRemanence_restart(swigCPtr, this);
  }

  public void setAnimatedMaterial(CAnimatedMaterial mat) {
    nel3dJNI.CSegRemanence_setAnimatedMaterial(swigCPtr, this, CAnimatedMaterial.getCPtr(mat), mat);
  }

  public CAnimatedMaterial getAnimatedMaterial() {
    long cPtr = nel3dJNI.CSegRemanence_getAnimatedMaterial(swigCPtr, this);
    return (cPtr == 0) ? null : new CAnimatedMaterial(cPtr, false);
  }

  public void registerToChannelMixer(CChannelMixer chanMixer, String prefix) {
    nel3dJNI.CSegRemanence_registerToChannelMixer(swigCPtr, this, CChannelMixer.getCPtr(chanMixer), chanMixer, prefix);
  }

  public ITrack getDefaultTrack(long valueId) {
    long cPtr = nel3dJNI.CSegRemanence_getDefaultTrack(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public void traverseAnimDetail() {
    nel3dJNI.CSegRemanence_traverseAnimDetail(swigCPtr, this);
  }

  public void setSliceTime(float duration) {
    nel3dJNI.CSegRemanence_setSliceTime(swigCPtr, this, duration);
  }

  public float getSliceTime() {
    return nel3dJNI.CSegRemanence_getSliceTime(swigCPtr, this);
  }

  public void clearAnimatedMatFlag() {
    nel3dJNI.CSegRemanence_clearAnimatedMatFlag(swigCPtr, this);
  }

  public final static class TAnimValues {
    public final static TAnimValues OwnerBit = new TAnimValues("OwnerBit", nel3dJNI.CSegRemanence_OwnerBit_get());
    public final static TAnimValues AnimValueLast = new TAnimValues("AnimValueLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TAnimValues swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TAnimValues.class + " with value " + swigValue);
    }

    private TAnimValues(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TAnimValues(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TAnimValues(String swigName, TAnimValues swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TAnimValues[] swigValues = { OwnerBit, AnimValueLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
